<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>宿舍管理</title>
    <link href="../../static/css/bootstrap.min.css" rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}">
    <!-- Custom styles for this template -->
    <link href="../../static/css/dashboard.css" rel="stylesheet" th:href="@{/static/css/dashboard.css}">
</head>
<body>
<div th:insert="admin/common::topbar"></div>
<div class="container-fluid">
    <div class="row">
        <div th:insert="~{admin/common::sidebar(active='operateDorm.html')}"></div>
        <main class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
                <h1 class="h3">宿舍管理</h1>
                <div class="btn-toolbar mb-2 mb-md-0">
                    <div class="btn-group mr-2">
                        <button class="btn btn-sm btn-outline-secondary" id="btn-dorm">事务办理</button>
                        <button class="btn btn-primary btn-sm btn-outline-secondary" id="btn-admin">管理员</button>
                        <button class="btn btn-sm btn-outline-secondary" id="btn-student">学生端</button>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped table-hover table-bordered table-sm">
                    <thead>
                    <tr>
                        <th>学号</th>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>寝室门牌</th>
                        <th>寝室类型</th>
                        <th>床位</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="list:${List}">
                        <th th:text="${list.getSno()}"></th>
                        <th th:text="${list.getSname()}"></th>
                        <th th:text="${list.getDorm_gender()}"></th>
                        <th th:text="${list.getDormPlace()}"></th>
                        <th th:text="${list.getDorm_number()+'人间'}"></th>
                        <th th:text="${list.getBed_id()+'号床'}"></th>
                    </tr>
                    </tbody>
                </table>
            </div>
            <nav aria-label="Page navigation" class="page-header">
                <ul class="pagination">
                    <li>
                        <a aria-label="Previous" id="pagePrevious"
                           th:href="@{/admin/getStudentDorm/{page}/{size}/(page=${page}-1,size=${size})}"
                           th:if="${lastPage}">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li><a class="nav active" id="page1"
                           th:href="@{/admin/getStudentDorm/{page}/{size}/(page=${page},size=${size})}"
                           th:if="teacherList!=null" th:text="${page}"></a></li>
                    <li><a id="page2" th:href="@{/admin/getStudentDorm/{page}/{size}/(page=${page+1},size=${size})}"
                           th:if="${number} gt ${page*size}" th:text="${page}+1"></a></li>
                    <li><a id="page3" th:href="@{/admin/getStudentDorm/{page}/{size}/(page=${page+2},size=${size})}"
                           th:if="${number} gt ${(page+1)*size}" th:text="${page}+2"></a></li>
                    <li><a id="page4" th:href="@{/admin/getStudentDorm/{page}/{size}/(page=${page+3},size=${size})}"
                           th:if="${number} gt ${(page+2)*size}" th:text="${page}+3"></a></li>
                    <li><a id="page5" th:href="@{/admin/getStudentDorm/{page}/{size}/(page=${page+4},size=${size})}"
                           th:if="${number} gt ${(page+3)*size}" th:text="${page}+4"></a></li>
                    <li>
                        <a aria-label="Next" id="pageNext"
                           th:href="@{/admin/getStudentDorm/{page}/{size}/(page=${page}+1,size=${size})}"
                           th:if="${nextPage}">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </main>
    </div>
</div>

<script src="../../static/js/jquery-3.6.0.js" th:src="@{/static/js/jquery-3.6.0.js}"></script>
<script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
<script src="../../static/js/btn.js" th:src="@{/static/js/btn.js}"></script>
<!--<script>
    $(function (){
        $('#btn-admin').click(function (){
            let result = confirm("是否进入管理员登录?");
            if (result===true){
                $(location).attr('href','/adminLogin.html');
            }else {

            }

        })
        $('#btn-student').click(function (){
            let result = confirm("是否重新登录?");
            if (result===true){
                $(location).attr('href','/studentLogin.html');
            }else {

            }

        })
    })
</script>-->
</body>
</html>